<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>京东小三角案例</title>
    <style>
        div {
            position: relative;
            width: 200px;
            height: 500px;
            background-color: pink;
            margin: 100px auto;
        }

        div span {
            position: absolute;
            right: 30px;
            top: -20px;
            width: 0;
            height: 0;
            /* 行高与字号是为了兼容低版本浏览器 */
            line-height: 0;
            font-size: 0;
            border: 10px solid transparent;
            border-bottom-color: pink;
        }
        .box1 {
            position: relative;
            width: 100px;
            height: 200px;
            background-color:peachpuff;
            margin:50px auto;
        }
        .box1 p {
            position: absolute;
            right: -20px;
            top:10px;
            width: 0;
            height: 0;
            line-height: 0;
            font-size: 0;
            border: 10px solid transparent;
            border-left-color:peachpuff;
        }
    
    </style>
</head>

<body>
    <div>
        <span></span>
    </div>
    <div class="box1">
        <p></p>
    </div>
</body>

</html>